add_libc_testsuite(libc_math_unittests)

add_fp_unittest(
  cosf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    cosf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.include.errno
    libc.src.math.cosf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  cos_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    cos_test.cpp
  DEPENDS
    libc.src.math.cos
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sinf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sinf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.include.errno
    libc.src.math.sinf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sin_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sin_test.cpp
  DEPENDS
    libc.src.math.sin
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sincosf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sincosf_test.cpp
  HDRS
    sdcomp26094.h
  DEPENDS
    libc.include.errno
    libc.src.math.sincosf
    libc.src.__support.CPP.array
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fabs_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    fabs_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fabs
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fabsf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    fabsf_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fabsf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fabsl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    fabsl_test.cpp
  HDRS
    FAbsTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fabsl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  trunc_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    trunc_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.include.math
    libc.src.math.trunc
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  truncf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    truncf_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.include.math
    libc.src.math.truncf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  truncl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    truncl_test.cpp
  HDRS
    TruncTest.h
  DEPENDS
    libc.include.math
    libc.src.math.truncl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ceil_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    ceil_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ceil
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ceilf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    ceilf_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ceilf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ceill_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    ceill_test.cpp
  HDRS
    CeilTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ceill
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  floor_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    floor_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.include.math
    libc.src.math.floor
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  floorf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    floorf_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.include.math
    libc.src.math.floorf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  floorl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    floorl_test.cpp
  HDRS
    FloorTest.h
  DEPENDS
    libc.include.math
    libc.src.math.floorl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  round_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    round_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.include.math
    libc.src.math.round
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  roundf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    roundf_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.include.math
    libc.src.math.roundf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  roundl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    roundl_test.cpp
  HDRS
    RoundTest.h
  DEPENDS
    libc.include.math
    libc.src.math.roundl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lround_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lround_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.lround
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lroundf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lroundf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.lroundf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lroundl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lroundl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.lroundl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llround_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llround_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.llround
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llroundf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llroundf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.llroundf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llroundl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llroundl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.errno.errno
    libc.src.fenv.feclearexcept
    libc.src.fenv.feraiseexcept
    libc.src.fenv.fetestexcept
    libc.src.math.llroundl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  rint_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    rint_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.include.math
    libc.src.math.rint
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  rintf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    rintf_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.include.math
    libc.src.math.rintf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  rintl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    rintl_test.cpp
  HDRS
    RIntTest.h
  DEPENDS
    libc.include.math
    libc.src.math.rintl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lrint_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lrint_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.lrint
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lrintf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lrintf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.lrintf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  lrintl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    lrintl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.lrintl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llrint_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llrint_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.llrint
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llrintf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llrintf_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.llrintf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  llrintl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    llrintl_test.cpp
  HDRS
    RoundToIntegerTest.h
  DEPENDS
    libc.include.math
    libc.src.math.llrintl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  expf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    expf_test.cpp
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.math.expf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  exp2f_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    exp2f_test.cpp
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.math.exp2f
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  copysign_test
  SUITE
    libc_math_unittests
  SRCS
    copysign_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.include.math
    libc.src.math.copysign
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  copysignf_test
  SUITE
    libc_math_unittests
  SRCS
    copysignf_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.include.math
    libc.src.math.copysignf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  copysignl_test
  SUITE
    libc_math_unittests
  SRCS
    copysignl_test.cpp
  HDRS
    CopySignTest.h
  DEPENDS
    libc.include.math
    libc.src.math.copysignl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  frexp_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    frexp_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.frexp
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  frexpf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    frexpf_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.frexpf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  frexpl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    frexpl_test.cpp
  HDRS
    FrexpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.frexpl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ilogb_test
  SUITE
    libc_math_unittests
  SRCS
    ilogb_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ilogb
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ilogbf_test
  SUITE
    libc_math_unittests
  SRCS
    ilogbf_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ilogbf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ilogbl_test
  SUITE
    libc_math_unittests
  SRCS
    ilogbl_test.cpp
  HDRS
    ILogbTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ilogbl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ldexp_test
  SUITE
    libc_math_unittests
  SRCS
    ldexp_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ldexp
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ldexpf_test
  SUITE
    libc_math_unittests
  SRCS
    ldexpf_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ldexpf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  ldexpl_test
  SUITE
    libc_math_unittests
  SRCS
    ldexpl_test.cpp
  HDRS
    LdExpTest.h
  DEPENDS
    libc.include.math
    libc.src.math.ldexpl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  logb_test
  SUITE
    libc_math_unittests
  SRCS
    logb_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.logb
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  logbf_test
  SUITE
    libc_math_unittests
  SRCS
    logbf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.logbf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  logbl_test
  SUITE
    libc_math_unittests
  SRCS
    logbl_test.cpp
  HDRS
    LogbTest.h
  DEPENDS
    libc.include.math
    libc.src.math.logbl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  modf_test
  SUITE
    libc_math_unittests
  SRCS
    modf_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.include.math
    libc.src.math.modf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  modff_test
  SUITE
    libc_math_unittests
  SRCS
    modff_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.include.math
    libc.src.math.modff
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  modfl_test
  SUITE
    libc_math_unittests
  SRCS
    modfl_test.cpp
  HDRS
    ModfTest.h
  DEPENDS
    libc.include.math
    libc.src.math.modfl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fdimf_test
  SUITE
    libc_math_unittests
  SRCS
    fdimf_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fdimf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fdim_test
  SUITE
    libc_math_unittests
  SRCS
    fdim_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fdim
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fdiml_test
  SUITE
    libc_math_unittests
  SRCS
    fdiml_test.cpp
  HDRS
    FDimTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fdiml
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fminf_test
  SUITE
    libc_math_unittests
  SRCS
    fminf_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fminf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmin_test
  SUITE
    libc_math_unittests
  SRCS
    fmin_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmin
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fminl_test
  SUITE
    libc_math_unittests
  SRCS
    fminl_test.cpp
  HDRS
    FMinTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fminl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmaxf_test
  SUITE
    libc_math_unittests
  SRCS
    fmaxf_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmaxf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmax_test
  SUITE
    libc_math_unittests
  SRCS
    fmax_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmax
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmaxl_test
  SUITE
    libc_math_unittests
  SRCS
    fmaxl_test.cpp
  HDRS
    FMaxTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmaxl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sqrtf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sqrtf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.sqrtf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sqrt_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sqrt_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.sqrt
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  sqrtl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    sqrtl_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.sqrtl
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  generic_sqrtf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    generic_sqrtf_test.cpp
  DEPENDS
    libc.src.math.sqrtf
    libc.src.__support.FPUtil.fputil
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  generic_sqrt_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    generic_sqrt_test.cpp
  DEPENDS
    libc.src.math.sqrt
    libc.src.__support.FPUtil.fputil
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  generic_sqrtl_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    generic_sqrtl_test.cpp
  DEPENDS
    libc.src.math.sqrtl
    libc.src.__support.FPUtil.fputil
    libc.src.__support.FPUtil.generic.sqrt
  COMPILE_OPTIONS
    -O3
)

add_fp_unittest(
  remquof_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    remquof_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.include.math
    libc.src.math.remquof
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  remquo_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    remquo_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.include.math
    libc.src.math.remquo
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  remquol_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    remquol_test.cpp
  HDRS
    RemQuoTest.h
  DEPENDS
    libc.include.math
    libc.src.math.remquol
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  hypotf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    hypotf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.hypotf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  hypot_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    hypot_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.hypot
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  nextafter_test
  SUITE
    libc_math_unittests
  SRCS
    nextafter_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.include.math
    libc.src.math.nextafter
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  nextafterf_test
  SUITE
    libc_math_unittests
  SRCS
    nextafterf_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.include.math
    libc.src.math.nextafterf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  nextafterl_test
  SUITE
    libc_math_unittests
  SRCS
    nextafterl_test.cpp
  HDRS
    NextAfterTest.h
  DEPENDS
    libc.include.math
    libc.src.math.nextafterl
    libc.src.__support.FPUtil.fputil
)

# TODO(lntue): The current implementation of fputil::general::fma<float> is only
# correctly rounded for the default rounding mode round-to-nearest tie-to-even.
add_fp_unittest(
  fmaf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    fmaf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.fmaf
    libc.src.__support.FPUtil.fputil
  FLAGS
    FMA_OPT__ONLY
)

add_fp_unittest(
  fma_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    fma_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.fma
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  tan_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    tan_test.cpp
  DEPENDS
    libc.src.math.tan
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  expm1f_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    expm1f_test.cpp
  DEPENDS
    libc.include.errno
    libc.include.math
    libc.src.math.expm1f
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  mod_k_pi_test
  NEED_MPFR
  SUITE
    libc-long-running-tests
  SRCS
    mod_k_pi_test.cpp
  DEPENDS
    libc.src.math.generic.dp_trig
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  logf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    logf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.logf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  log2f_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    log2f_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.log2f
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  log10f_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    log10f_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.log10f
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  log1pf_test
  NEED_MPFR
  SUITE
    libc_math_unittests
  SRCS
    log1pf_test.cpp
  DEPENDS
    libc.include.math
    libc.src.math.log1pf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmodf_test
  SUITE
    libc_math_unittests
  SRCS
    fmodf_test.cpp
  HDRS
    FModTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmodf
    libc.src.__support.FPUtil.fputil
)

add_fp_unittest(
  fmod_test
  SUITE
    libc_math_unittests
  SRCS
    fmod_test.cpp
  HDRS
    FModTest.h
  DEPENDS
    libc.include.math
    libc.src.math.fmod
    libc.src.__support.FPUtil.fputil
)

add_subdirectory(generic)
add_subdirectory(exhaustive)
add_subdirectory(differential_testing)
